import http from '@/utils/request'

/**
 * 系统用户登录(不鉴权)
 * @param  data 
 * @returns 
 */
export function login(data) {
    return http.post('/admin/login', data)
}

/**
 * 系统用户登出
 * @returns 
 */
export const logoutApi = () => {
  return http.delete("/admin/logout");
};


/**
 * 获取用户菜单树
 * @returns
 */
export const getAuthMenuListApi = () => {
  return http.get("/admin/getMenus", {},false);
};


/**
 * 获取用户元素(特指按钮)权限
 */
export const getAuthElement = () => {
  return http.get("/admin/getAuthElement", {},false);
};

/**
 * 获取在线用户列表
 */
export const getOnlineUserList = (params) => {
  return http.post("/admin/getOnlineUser", params);
};

/**
 * 强制登出操作
 */
export const forceLogout = (token) => {
  return http.delete("/admin/forceLogout", { token });
};

/**
 * 用户修改密码
 */
export const changePasswordApi = (params) => {
  return http.post("/admin/changePassword", params);
};

/**
 * 用户修改基本信息
 */
export const updateUserInfoApi = (params) => {
  return http.post("/admin/changeMyInfo", params);
};